//
//  HJHomeTitleButton.swift
//  sinaWeibo
//
//  Created by hjun on 16/3/25.
//  Copyright © 2016年 hjun. All rights reserved.
//

import UIKit

class HJHomeTitleButton: UIButton {
    
    convenience init(title: String?, imageName: String){
        
        self.init()
        
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        sizeToFit()
      
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        
        //将titleLabel移动到左边
        
        imageView?.frame.origin.x = (titleLabel?.frame.width)! + 3
    
    
    
    }
    
    
}
